import { RouteRecordRaw } from 'vue-router'
import { DashboardRound, AdminPanelSettingsRound, PendingActionsOutlined, SendToMobileRound, SettingsApplicationsRound, DirectionsCarFilledFilled, LocationCityFilled, MenuBookRound } from '@vicons/material'
import { FlowLogsVpc } from '@vicons/carbon'
import { renderIcon } from '@/util'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/sys',
        name: 'sys',
        redirect: '/sys/emp',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '系统管理',
            icon: renderIcon(DashboardRound),
            role: 'Adm',
            sort: 5,
        },
        children: [
            {
                path: 'emp',
                name: 'sys.emp',
                meta: {
                    title: '员工管理',
                    icon: renderIcon(AdminPanelSettingsRound),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/emp/Index.vue'),
            },
            {
                path: 'config',
                name: 'sys.config',
                meta: {
                    title: '全局配置',
                    icon: renderIcon(SettingsApplicationsRound),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/config/Index.vue'),
            },
            {
                path: 'dict',
                name: 'sys.dict',
                meta: {
                    title: '数据字典',
                    icon: renderIcon(MenuBookRound),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/dict/Index.vue'),
            },
            {
                path: 'citys',
                name: 'sys.citys',
                meta: {
                    title: '城市配置',
                    icon: renderIcon(LocationCityFilled),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/citys/Index.vue'),
            },
            {
                path: 'carmodel',
                name: 'sys.carmodel',
                meta: {
                    title: '车型管理',
                    icon: renderIcon(DirectionsCarFilledFilled),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/carmodel/Index.vue'),
            },
            {
                path: 'loginlog',
                name: 'sys.loginlog',
                meta: {
                    title: '登录日志',
                    icon: renderIcon(FlowLogsVpc),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/logs/login/Index.vue'),
            },
            {
                path: 'actionlog',
                name: 'sys.actionlog',
                meta: {
                    title: '操作日志',
                    icon: renderIcon(PendingActionsOutlined),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/logs/action/Index.vue'),
            },
            {
                path: 'smslog',
                name: 'sys.smslog',
                meta: {
                    title: '短信日志',
                    icon: renderIcon(SendToMobileRound),
                    role: 'Adm',
                },
                component: () => import('@/views/sys/logs/sms/Index.vue'),
            },
        ],
    },
]

export default routes
